#!/usr/bin/env python
# Hello world test
# Purpose: transmit data to the web service
#source code from: http://www.boddie.org.uk/python/HTML.html

import urllib, sys

#Runs an individual test
message = 'failed'
try:
  params = { "latitude":"44", "longitude":"22" }
  f = urllib.urlopen("http://webservices.wyswebems.com.au/VicinityJSON/VicinityJSON.asmx/businessInLocation", urllib.urlencode(params))
  #f = urllib.urlopen("http://webservices.wyswebems.com.au/ClientWebService/Service.asmx/HelloWorld")
  actual = urllib.unquote(f.read())
  #actual = actual[actual.find('"Table:" : ['):actual.find("</string>")]
  f.close()
  message += ' actual:\n'+actual
except:
  pass

print(message);

